<?php 

//算数运算符
$a = 32;
$b = 8;

$n1 = $a + $b;
$n2 = $a - $b;
$n3 = $a * $b;
$n4 = $a / $b;
$n5 = $a % $b;

printf("%d + %d = %d\n", $a, $b, $n1);
printf("%d - %d = %d\n", $a, $b, $n2);
printf("%d * %d = %d\n", $a, $b, $n3);
printf("%d / %d = %d\n", $a, $b, $n4);
printf("%d %% %d = %d\n", $a, $b, $n5);

echo '<br/>自增/自减<br/>';
$a = 32;
$b = 8;
$c = $a++;
$d = $b--;
printf("a,b = %d, %d\n", $a, $b);
$e = ++$a;
printf("c,d,e,a = %d, %d, %d, %d\n", $c, $d, $e, $a);

echo '<br/>比较运算符<br/>';
$c = 32;
$d = 32.0;
var_dump($c == $d);
var_dump($c != $d);
var_dump($c === $d);
var_dump($c !== $d);
var_dump($a <=> $b);
var_dump(1 <=> $b);
var_dump(7 <=> $b);

echo '<br/>逻辑运算符<br/>';
